﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Communergy.Common;
using CommunergyUploader;

namespace CurrentCostGUI
{
    public partial class SelectMeter : Form
    {
        public SelectMeter()
        {
            InitializeComponent();
        }


        public Communergy.Common.Meter SelectedMeter 
        {
            get
            {
                var selectedMeter = cboMeter.SelectedItem as Communergy.Common.Meter;
                return selectedMeter;
            }
        }

        private void SelectMeter_Load(object sender, EventArgs e)
        {
            IMeterRepository localMetersRepository = CommunergyClientFactory.GetLocalMeterStore();
            var localMeters = localMetersRepository.GetMetersForUser(null);
            cboMeter.DisplayMember = "MeterName";
            cboMeter.DataSource = localMeters;
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            
        }

        private void btnOK_Click(object sender, EventArgs e)
        {

        }
    }
}
